import QtQuick
import QtMultimedia

Rectangle {
    id: tipsTextRect
    width: 180
    height: 100
    visible: false
    radius: 10

    function showTips(text) {
        focus = true
        visible = true
        tipsText.text = text
        audioPlayer.play()
//        tipsTimeText.text = Qt.formatDateTime(new Date(), "yyyy/MM/dd  hh:mm:ss")
    }

    MediaPlayer {
        id: audioPlayer
        source: "qrc:/audios/tips.wav"
        audioOutput: AudioOutput {}
    }

    Row {
        anchors.fill: parent
        spacing: 5
        leftPadding: 5

        Image {
            id: tipsTitleText
            y: (parent.height - height) / 2
            width: 20
            height: 20
            source: "qrc:/imgs/tip.png"
        }

        AsText {
            id: tipsText
            width: parent.width  - tipsTitleText.width - parent.leftPadding * 2
            height: parent.height
            font.pixelSize: 15
            text: qsTr("导入完成!")
            wrapMode: Text.WrapAnywhere
            verticalAlignment: Text.AlignVCenter
            horizontalAlignment: Text.AlignLeft
        }

//        AsText {
//            id: tipsTimeText
//            width: parent.width  - parent.padding * 2
//            height: 20
//            font.pixelSize: 12
//            verticalAlignment: Text.AlignVCenter
//            horizontalAlignment: Text.AlignRight
//        }
    }
}
